Carbon


NavAskDiscardChanges

Header: Navigation.h Carbon status: Supported

Displays an alert box that asks the user whether to discard changes to a particular document.

OSErr NavAskDiscardChanges (
    NavDialogOptions *dialogOptions, 
    NavAskDiscardChangesResult *reply, 
    NavEventUPP eventProc, 
    void *callBackUD
);
Parameter descriptions
dialogOptions

A pointer to a structure of type NavDialogOptions. Before calling NavAskDiscardChanges, set up this structure to specify dialog box settings. In this case, the savedFileName field is the only one you must supply with a value.

reply

A pointer to a structure of type NavAskDiscardChanges. On return, the value describes the user’s response to the Discard Changes alert box. For a description of the constants used to represent possible responses, see “Discard Changes Action Constants”.

eventProc

A Universal Procedure Pointer (UPP) of type NavEventProcPtr that points to your application-defined event-handling function. You obtain this UPP by calling the macro NewNavEventProc. Implementing an event-handling function allows your application to update windows after the user moves or resizes the dialog box. If you pass NULL in this parameter, the Discard Changes alert box is not movable. For more information, see “Handling Events”.

callBackUD

A pointer to a value set by your application. When the NavAskDiscardChanges function calls your event-handling function, the callBackUD value is passed back to your application.

function result

A result code.

DISCUSSION

If your application provides a Revert to Saved command, you can use the NavAskDiscardChanges function to display a confirmation alert box when a user selects Revert to Saved for a document with unsaved changes. Navigation Services uses the string you supply in the savedFileName field of the NavDialogOptions structure you passed in the dialogOptions parameter to display the alert message, “Discard changes to ?”.

VERSION NOTES

Available in Navigation Services 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)